.class public Lcom/instagram/android/feed/ui/h;
.super Landroid/graphics/drawable/Drawable;
.source "PaddedRoundedBitmapDrawable.java"


# instance fields
.field private a:Lcom/instagram/android/feed/ui/j;

.field private b:Landroid/graphics/Bitmap;

.field private c:I

.field private d:Z

.field private e:I

.field private f:I


# direct methods
.method public constructor <init>(Landroid/content/res/Resources;Landroid/graphics/Bitmap;)V
    .locals 2
    .parameter
    .parameter

    .prologue
    .line 80
    new-instance v0, Lcom/instagram/android/feed/ui/j;

    invoke-direct {v0, p2}, Lcom/instagram/android/feed/ui/j;-><init>(Landroid/graphics/Bitmap;)V

    invoke-direct {p0, v0, p1}, Lcom/instagram/android/feed/ui/h;-><init>(Lcom/instagram/android/feed/ui/j;Landroid/content/res/Resources;)V

    .line 81
    iget-object v0, p0, Lcom/instagram/android/feed/ui/h;->a:Lcom/instagram/android/feed/ui/j;

    iget v1, p0, Lcom/instagram/android/feed/ui/h;->c:I

    iput v1, v0, Lcom/instagram/android/feed/ui/j;->k:I

    .line 82
    return-void
.end method

.method private constructor <init>(Lcom/instagram/android/feed/ui/j;Landroid/content/res/Resources;)V
    .locals 1
    .parameter
    .parameter

    .prologue
    .line 447
    invoke-direct {p0}, Landroid/graphics/drawable/Drawable;-><init>()V

    .line 448
    iput-object p1, p0, Lcom/instagram/android/feed/ui/h;->a:Lcom/instagram/android/feed/ui/j;

    .line 449
    if-eqz p2, :cond_0

    .line 450
    invoke-virtual {p2}, Landroid/content/res/Resources;->getDisplayMetrics()Landroid/util/DisplayMetrics;

    move-result-object v0

    iget v0, v0, Landroid/util/DisplayMetrics;->densityDpi:I

    iput v0, p0, Lcom/instagram/android/feed/ui/h;->c:I

    .line 454
    :goto_0
    if-eqz p1, :cond_1

    iget-object v0, p1, Lcom/instagram/android/feed/ui/j;->a:Landroid/graphics/Bitmap;

    :goto_1
    invoke-direct {p0, v0}, Lcom/instagram/android/feed/ui/h;->a(Landroid/graphics/Bitmap;)V

    .line 455
    return-void

    .line 452
    :cond_0
    iget v0, p1, Lcom/instagram/android/feed/ui/j;->k:I

    iput v0, p0, Lcom/instagram/android/feed/ui/h;->c:I

    goto :goto_0

    .line 454
    :cond_1
    const/4 v0, 0x0

    goto :goto_1
.end method

.method synthetic constructor <init>(Lcom/instagram/android/feed/ui/j;Landroid/content/res/Resources;Lcom/instagram/android/feed/ui/i;)V
    .locals 0
    .parameter
    .parameter
    .parameter

    .prologue
    .line 51
    invoke-direct {p0, p1, p2}, Lcom/instagram/android/feed/ui/h;-><init>(Lcom/instagram/android/feed/ui/j;Landroid/content/res/Resources;)V

    return-void
.end method

.method private a()V
    .locals 2

    .prologue
    .line 124
    iget-object v0, p0, Lcom/instagram/android/feed/ui/h;->b:Landroid/graphics/Bitmap;

    iget v1, p0, Lcom/instagram/android/feed/ui/h;->c:I

    invoke-virtual {v0, v1}, Landroid/graphics/Bitmap;->getScaledWidth(I)I

    move-result v0

    iput v0, p0, Lcom/instagram/android/feed/ui/h;->e:I

    .line 125
    iget-object v0, p0, Lcom/instagram/android/feed/ui/h;->b:Landroid/graphics/Bitmap;

    iget v1, p0, Lcom/instagram/android/feed/ui/h;->c:I

    invoke-virtual {v0, v1}, Landroid/graphics/Bitmap;->getScaledHeight(I)I

    move-result v0

    iput v0, p0, Lcom/instagram/android/feed/ui/h;->f:I

    .line 126
    return-void
.end method

.method private a(Landroid/graphics/Bitmap;)V
    .locals 1
    .parameter

    .prologue
    .line 129
    iget-object v0, p0, Lcom/instagram/android/feed/ui/h;->b:Landroid/graphics/Bitmap;

    if-eq p1, v0, :cond_0

    .line 130
    iput-object p1, p0, Lcom/instagram/android/feed/ui/h;->b:Landroid/graphics/Bitmap;

    .line 131
    if-eqz p1, :cond_1

    .line 132
    invoke-direct {p0}, Lcom/instagram/android/feed/ui/h;->a()V

    .line 136
    :goto_0
    invoke-virtual {p0}, Lcom/instagram/android/feed/ui/h;->invalidateSelf()V

    .line 138
    :cond_0
    return-void

    .line 134
    :cond_1
    const/4 v0, -0x1

    iput v0, p0, Lcom/instagram/android/feed/ui/h;->f:I

    iput v0, p0, Lcom/instagram/android/feed/ui/h;->e:I

    goto :goto_0
.end method


# virtual methods
.method public a(II)V
    .locals 2
    .parameter
    .parameter

    .prologue
    .line 282
    iget-object v0, p0, Lcom/instagram/android/feed/ui/h;->a:Lcom/instagram/android/feed/ui/j;

    .line 283
    iget v1, v0, Lcom/instagram/android/feed/ui/j;->g:I

    if-ne v1, p1, :cond_0

    iget v1, v0, Lcom/instagram/android/feed/ui/j;->h:I

    if-eq v1, p2, :cond_1

    .line 284
    :cond_0
    iput p1, v0, Lcom/instagram/android/feed/ui/j;->g:I

    .line 285
    iput p2, v0, Lcom/instagram/android/feed/ui/j;->h:I

    .line 286
    const/4 v1, 0x1

    iput-boolean v1, v0, Lcom/instagram/android/feed/ui/j;->m:Z

    .line 287
    invoke-virtual {p0}, Lcom/instagram/android/feed/ui/h;->invalidateSelf()V

    .line 289
    :cond_1
    return-void
.end method

.method public a(Landroid/graphics/Shader$TileMode;Landroid/graphics/Shader$TileMode;)V
    .locals 2
    .parameter
    .parameter

    .prologue
    .line 272
    iget-object v0, p0, Lcom/instagram/android/feed/ui/h;->a:Lcom/instagram/android/feed/ui/j;

    .line 273
    iget-object v1, v0, Lcom/instagram/android/feed/ui/j;->e:Landroid/graphics/Shader$TileMode;

    if-ne v1, p1, :cond_0

    iget-object v1, v0, Lcom/instagram/android/feed/ui/j;->f:Landroid/graphics/Shader$TileMode;

    if-eq v1, p2, :cond_1

    .line 274
    :cond_0
    iput-object p1, v0, Lcom/instagram/android/feed/ui/j;->e:Landroid/graphics/Shader$TileMode;

    .line 275
    iput-object p2, v0, Lcom/instagram/android/feed/ui/j;->f:Landroid/graphics/Shader$TileMode;

    .line 276
    const/4 v1, 0x1

    iput-boolean v1, v0, Lcom/instagram/android/feed/ui/j;->l:Z

    .line 277
    invoke-virtual {p0}, Lcom/instagram/android/feed/ui/h;->invalidateSelf()V

    .line 279
    :cond_1
    return-void
.end method

.method public b(II)V
    .locals 2
    .parameter
    .parameter

    .prologue
    .line 292
    iget-object v0, p0, Lcom/instagram/android/feed/ui/h;->a:Lcom/instagram/android/feed/ui/j;

    .line 293
    iget v1, v0, Lcom/instagram/android/feed/ui/j;->i:I

    if-ne v1, p1, :cond_0

    iget v1, v0, Lcom/instagram/android/feed/ui/j;->j:I

    if-eq v1, p2, :cond_1

    .line 294
    :cond_0
    iput p1, v0, Lcom/instagram/android/feed/ui/j;->i:I

    .line 295
    iput p2, v0, Lcom/instagram/android/feed/ui/j;->j:I

    .line 296
    const/4 v1, 0x1

    iput-boolean v1, v0, Lcom/instagram/android/feed/ui/j;->m:Z

    .line 297
    invoke-virtual {p0}, Lcom/instagram/android/feed/ui/h;->invalidateSelf()V

    .line 299
    :cond_1
    return-void
.end method

.method public draw(Landroid/graphics/Canvas;)V
    .locals 7
    .parameter "canvas"

    .prologue
    const/4 v6, 0x0

    .line 308
    iget-object v2, p0, Lcom/instagram/android/feed/ui/h;->b:Landroid/graphics/Bitmap;

    .line 309
    if-eqz v2, :cond_2

    .line 310
    iget-object v3, p0, Lcom/instagram/android/feed/ui/h;->a:Lcom/instagram/android/feed/ui/j;

    .line 312
    iget-boolean v0, v3, Lcom/instagram/android/feed/ui/j;->l:Z

    if-eqz v0, :cond_0

    .line 313
    iget-object v1, v3, Lcom/instagram/android/feed/ui/j;->e:Landroid/graphics/Shader$TileMode;

    .line 314
    iget-object v0, v3, Lcom/instagram/android/feed/ui/j;->f:Landroid/graphics/Shader$TileMode;

    .line 316
    if-nez v1, :cond_3

    if-nez v0, :cond_3

    .line 317
    iget-object v0, v3, Lcom/instagram/android/feed/ui/j;->c:Landroid/graphics/Paint;

    const/4 v1, 0x0

    invoke-virtual {v0, v1}, Landroid/graphics/Paint;->setShader(Landroid/graphics/Shader;)Landroid/graphics/Shader;

    .line 323
    :goto_0
    iput-boolean v6, v3, Lcom/instagram/android/feed/ui/j;->l:Z

    .line 326
    :cond_0
    iget-boolean v0, v3, Lcom/instagram/android/feed/ui/j;->m:Z

    if-eqz v0, :cond_1

    .line 327
    new-instance v0, Landroid/graphics/Path;

    invoke-direct {v0}, Landroid/graphics/Path;-><init>()V

    iput-object v0, v3, Lcom/instagram/android/feed/ui/j;->d:Landroid/graphics/Path;

    .line 328
    new-instance v0, Landroid/graphics/RectF;

    invoke-virtual {p0}, Lcom/instagram/android/feed/ui/h;->getBounds()Landroid/graphics/Rect;

    move-result-object v1

    invoke-direct {v0, v1}, Landroid/graphics/RectF;-><init>(Landroid/graphics/Rect;)V

    .line 329
    iget v1, v0, Landroid/graphics/RectF;->right:F

    iget v2, v3, Lcom/instagram/android/feed/ui/j;->i:I

    mul-int/lit8 v2, v2, 0x2

    int-to-float v2, v2

    sub-float/2addr v1, v2

    iput v1, v0, Landroid/graphics/RectF;->right:F

    .line 330
    iget v1, v0, Landroid/graphics/RectF;->bottom:F

    iget v2, v3, Lcom/instagram/android/feed/ui/j;->j:I

    mul-int/lit8 v2, v2, 0x2

    int-to-float v2, v2

    sub-float/2addr v1, v2

    iput v1, v0, Landroid/graphics/RectF;->bottom:F

    .line 331
    iget-object v1, v3, Lcom/instagram/android/feed/ui/j;->d:Landroid/graphics/Path;

    iget v2, v3, Lcom/instagram/android/feed/ui/j;->g:I

    int-to-float v2, v2

    iget v4, v3, Lcom/instagram/android/feed/ui/j;->h:I

    int-to-float v4, v4

    sget-object v5, Landroid/graphics/Path$Direction;->CW:Landroid/graphics/Path$Direction;

    invoke-virtual {v1, v0, v2, v4, v5}, Landroid/graphics/Path;->addRoundRect(Landroid/graphics/RectF;FFLandroid/graphics/Path$Direction;)V

    .line 333
    iput-boolean v6, v3, Lcom/instagram/android/feed/ui/j;->m:Z

    .line 336
    :cond_1
    invoke-virtual {p1}, Landroid/graphics/Canvas;->save()I

    .line 337
    iget v0, v3, Lcom/instagram/android/feed/ui/j;->i:I

    int-to-float v0, v0

    iget v1, v3, Lcom/instagram/android/feed/ui/j;->j:I

    int-to-float v1, v1

    invoke-virtual {p1, v0, v1}, Landroid/graphics/Canvas;->translate(FF)V

    .line 338
    iget-object v0, v3, Lcom/instagram/android/feed/ui/j;->d:Landroid/graphics/Path;

    iget-object v1, v3, Lcom/instagram/android/feed/ui/j;->c:Landroid/graphics/Paint;

    invoke-virtual {p1, v0, v1}, Landroid/graphics/Canvas;->drawPath(Landroid/graphics/Path;Landroid/graphics/Paint;)V

    .line 339
    invoke-virtual {p1}, Landroid/graphics/Canvas;->restore()V

    .line 341
    :cond_2
    return-void

    .line 319
    :cond_3
    iget-object v4, v3, Lcom/instagram/android/feed/ui/j;->c:Landroid/graphics/Paint;

    new-instance v5, Landroid/graphics/BitmapShader;

    if-nez v1, :cond_4

    sget-object v1, Landroid/graphics/Shader$TileMode;->CLAMP:Landroid/graphics/Shader$TileMode;

    :cond_4
    if-nez v0, :cond_5

    sget-object v0, Landroid/graphics/Shader$TileMode;->CLAMP:Landroid/graphics/Shader$TileMode;

    :cond_5
    invoke-direct {v5, v2, v1, v0}, Landroid/graphics/BitmapShader;-><init>(Landroid/graphics/Bitmap;Landroid/graphics/Shader$TileMode;Landroid/graphics/Shader$TileMode;)V

    invoke-virtual {v4, v5}, Landroid/graphics/Paint;->setShader(Landroid/graphics/Shader;)Landroid/graphics/Shader;

    goto :goto_0
.end method

.method public getChangingConfigurations()I
    .locals 2

    .prologue
    .line 303
    invoke-super {p0}, Landroid/graphics/drawable/Drawable;->getChangingConfigurations()I

    move-result v0

    iget-object v1, p0, Lcom/instagram/android/feed/ui/h;->a:Lcom/instagram/android/feed/ui/j;

    iget v1, v1, Lcom/instagram/android/feed/ui/j;->b:I

    or-int/2addr v0, v1

    return v0
.end method

.method public final getConstantState()Landroid/graphics/drawable/Drawable$ConstantState;
    .locals 2

    .prologue
    .line 392
    iget-object v0, p0, Lcom/instagram/android/feed/ui/h;->a:Lcom/instagram/android/feed/ui/j;

    invoke-virtual {p0}, Lcom/instagram/android/feed/ui/h;->getChangingConfigurations()I

    move-result v1

    iput v1, v0, Lcom/instagram/android/feed/ui/j;->b:I

    .line 393
    iget-object v0, p0, Lcom/instagram/android/feed/ui/h;->a:Lcom/instagram/android/feed/ui/j;

    return-object v0
.end method

.method public getIntrinsicHeight()I
    .locals 1

    .prologue
    .line 380
    iget v0, p0, Lcom/instagram/android/feed/ui/h;->f:I

    return v0
.end method

.method public getIntrinsicWidth()I
    .locals 1

    .prologue
    .line 375
    iget v0, p0, Lcom/instagram/android/feed/ui/h;->e:I

    return v0
.end method

.method public getOpacity()I
    .locals 2

    .prologue
    .line 385
    iget-object v0, p0, Lcom/instagram/android/feed/ui/h;->b:Landroid/graphics/Bitmap;

    .line 386
    if-eqz v0, :cond_0

    invoke-virtual {v0}, Landroid/graphics/Bitmap;->hasAlpha()Z

    move-result v0

    if-nez v0, :cond_0

    iget-object v0, p0, Lcom/instagram/android/feed/ui/h;->a:Lcom/instagram/android/feed/ui/j;

    iget-object v0, v0, Lcom/instagram/android/feed/ui/j;->c:Landroid/graphics/Paint;

    invoke-virtual {v0}, Landroid/graphics/Paint;->getAlpha()I

    move-result v0

    const/16 v1, 0xff

    if-ge v0, v1, :cond_1

    :cond_0
    const/4 v0, -0x3

    :goto_0
    return v0

    :cond_1
    const/4 v0, -0x1

    goto :goto_0
.end method

.method public mutate()Landroid/graphics/drawable/Drawable;
    .locals 2

    .prologue
    .line 366
    iget-boolean v0, p0, Lcom/instagram/android/feed/ui/h;->d:Z

    if-nez v0, :cond_0

    invoke-super {p0}, Landroid/graphics/drawable/Drawable;->mutate()Landroid/graphics/drawable/Drawable;

    move-result-object v0

    if-ne v0, p0, :cond_0

    .line 367
    new-instance v0, Lcom/instagram/android/feed/ui/j;

    iget-object v1, p0, Lcom/instagram/android/feed/ui/h;->a:Lcom/instagram/android/feed/ui/j;

    invoke-direct {v0, v1}, Lcom/instagram/android/feed/ui/j;-><init>(Lcom/instagram/android/feed/ui/j;)V

    iput-object v0, p0, Lcom/instagram/android/feed/ui/h;->a:Lcom/instagram/android/feed/ui/j;

    .line 368
    const/4 v0, 0x1

    iput-boolean v0, p0, Lcom/instagram/android/feed/ui/h;->d:Z

    .line 370
    :cond_0
    return-object p0
.end method

.method public setAlpha(I)V
    .locals 1
    .parameter "alpha"

    .prologue
    .line 345
    iget-object v0, p0, Lcom/instagram/android/feed/ui/h;->a:Lcom/instagram/android/feed/ui/j;

    iget-object v0, v0, Lcom/instagram/android/feed/ui/j;->c:Landroid/graphics/Paint;

    invoke-virtual {v0}, Landroid/graphics/Paint;->getAlpha()I

    move-result v0

    .line 346
    if-eq p1, v0, :cond_0

    .line 347
    iget-object v0, p0, Lcom/instagram/android/feed/ui/h;->a:Lcom/instagram/android/feed/ui/j;

    iget-object v0, v0, Lcom/instagram/android/feed/ui/j;->c:Landroid/graphics/Paint;

    invoke-virtual {v0, p1}, Landroid/graphics/Paint;->setAlpha(I)V

    .line 348
    invoke-virtual {p0}, Lcom/instagram/android/feed/ui/h;->invalidateSelf()V

    .line 350
    :cond_0
    return-void
.end method

.method public setColorFilter(Landroid/graphics/ColorFilter;)V
    .locals 1
    .parameter "cf"

    .prologue
    .line 354
    iget-object v0, p0, Lcom/instagram/android/feed/ui/h;->a:Lcom/instagram/android/feed/ui/j;

    iget-object v0, v0, Lcom/instagram/android/feed/ui/j;->c:Landroid/graphics/Paint;

    invoke-virtual {v0, p1}, Landroid/graphics/Paint;->setColorFilter(Landroid/graphics/ColorFilter;)Landroid/graphics/ColorFilter;

    .line 355
    invoke-virtual {p0}, Lcom/instagram/android/feed/ui/h;->invalidateSelf()V

    .line 356
    return-void
.end method

.method public setDither(Z)V
    .locals 1
    .parameter "dither"

    .prologue
    .line 203
    iget-object v0, p0, Lcom/instagram/android/feed/ui/h;->a:Lcom/instagram/android/feed/ui/j;

    iget-object v0, v0, Lcom/instagram/android/feed/ui/j;->c:Landroid/graphics/Paint;

    invoke-virtual {v0, p1}, Landroid/graphics/Paint;->setDither(Z)V

    .line 204
    invoke-virtual {p0}, Lcom/instagram/android/feed/ui/h;->invalidateSelf()V

    .line 205
    return-void
.end method

.method public setFilterBitmap(Z)V
    .locals 1
    .parameter "filter"

    .prologue
    .line 197
    iget-object v0, p0, Lcom/instagram/android/feed/ui/h;->a:Lcom/instagram/android/feed/ui/j;

    iget-object v0, v0, Lcom/instagram/android/feed/ui/j;->c:Landroid/graphics/Paint;

    invoke-virtual {v0, p1}, Landroid/graphics/Paint;->setFilterBitmap(Z)V

    .line 198
    invoke-virtual {p0}, Lcom/instagram/android/feed/ui/h;->invalidateSelf()V

    .line 199
    return-void
.end method
